package com.consumer.asyncTask;

import com.consumer.entity.TPlane;
import com.consumer.entity.TProductPlane;
import com.consumer.service.impl.MigrationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

@Service
public class AsyncTask {

    @Autowired
    MigrationService migrationService;

    @Async
    public void migrateProject(String systemId) {
        migrationService.migrateDemand(systemId);
    }

    @Async
    public void migrateProduct(String systemId) {
//        migrationService.migrateProductDemand(systemId);
        migrationService.migrateProductTask(systemId);
    }

    @Async
    public void createProjectBucket(TPlane tPlane) throws Exception {
        migrationService.createProjectBucket(tPlane);
    }
    @Async
    public void createProductBucket(TProductPlane tPlane) throws Exception {
        migrationService.createProductBucket(tPlane);
    }


    public void moveProjectBucketFile(TPlane take) {
        migrationService.moveProjectBucketFile(take);
    }
    public void moveProductBucketFile(TProductPlane take) {
        migrationService.moveProductBucketFile(take);
    }
}
